Skip to content

Conversation

EtienneLt
Copy link
Contributor

No description provided.

@EtienneLt EtienneLt self-assigned this Aug 25, 2025
}

private void processConnectivityPosition(ConnectablePosition<?> connectablePosition,
public void processConnectivityPosition(ConnectablePosition<?> connectablePosition,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep private here :/

Copy link

private String voltageLevelId;

@Schema(description = "Feeder bays list")
private List<ConnectablePositionModificationInfos> feederBaysAttributeList;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private List<ConnectablePositionModificationInfos> feederBaysAttributeList;
private List<ConnectablePositionModificationInfos> feederBays;

* @author Slimane Amar <slimane.amar at rte-france.com>
*/
// FIXME : to remove when this class is available in network-store
public class BusbarSectionFinderTraverser implements Terminal.TopologyTraverser {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move those changes in another PR. So the review can be done with gridsuite/network-map-server#288. And the changes in the tests will be reviewed with it

BusbarSectionFinderTraverser connectedBusbarSectionFinder = new BusbarSectionFinderTraverser(terminal.isConnected());
terminal.traverse(connectedBusbarSectionFinder, TraversalType.BREADTH_FIRST);
return connectedBusbarSectionFinder.getFirstTraversedBbsId();
BusbarSectionFinderTraverser finder = new BusbarSectionFinderTraverser();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move those changes in another PR. So the review can be done with gridsuite/network-map-server#288. And the changes in the tests will be reviewed with it

network.modification.TotalOutwardHvdcFlow = The HVDC balance is : ${hvdcBalance} MW
network.modification.TwoWindingsTransformerProperties = Properties
network.modification.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION = Voltage Level topology modification ${voltageLevelId}
network.modification.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS = Move voltage level feeder bays modification ${voltageLevelId}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check US specification for logs. That's not what is asked

Generator generator = getNetwork().getGenerator("idGenerator");
Terminal terminal = generator.getTerminal();
assertEquals("v2", terminal.getVoltageLevel().getId());
BusbarSectionFinderTraverser connectedBusbarSectionFinder = new BusbarSectionFinderTraverser(terminal.isConnected());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move those changes in another PR. So the review can be done with gridsuite/network-map-server#288

if (connectable == null) {
throw new NetworkModificationException(MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_ERROR, String.format(CONNECTABLE_NOT_FOUND, info.getEquipmentId()));
}
if (!(connectable instanceof Injection<?>) && !(connectable instanceof Branch<?>)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it excudes 3WT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rather exclude busbarSection as it is done in MoveFeederBay. Something like :
(connectable instanceof BusbarSection) throw ...

return ModificationType.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS.name();
}

private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifyInjectionConnectablePosition and modifyBranchConnectablePosition should be one method modifyConnectablePosition().
With a if else for modifyInjectionConnectivityAttributes() and modifyBranchConnectivityAttributes()

private InjectionModificationInfos buildInjectionModificationInfos(ConnectablePositionModificationInfos info) {
InjectionModificationInfos injectionInfos = new InjectionModificationInfos();
injectionInfos.setEquipmentId(info.getEquipmentId());
injectionInfos.setConnectionPosition(new AttributeModification<>(info.getConnectionPosition(), OperationType.SET));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those 3 rows can be a method. And the method used here and in buildBranchModificationInfos()

Connectable<?> connectable = network.getConnectable(info.getEquipmentId());
return switch (connectable) {
case Injection<?> injection -> injection.getTerminal();
case Branch<?> branch -> getTerminalFromBranch(branch, info);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case Branch<?> branch -> getTerminalFromBranch(branch, info);
case Branch<?> branch -> branch.getTerminal(info.getConnectionSide());

};
}

private Terminal getTerminalFromBranch(Branch<?> branch, ConnectablePositionModificationInfos info) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove method

@Setter
@ToString(callSuper = true)
@Schema(description = "Connectable position modification")
public class ConnectablePositionModificationInfos {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class ConnectablePositionModificationInfos {
public class MoveFeederBayInfos {

}

private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) {
ConnectablePosition connectablePosition = injection.getExtension(ConnectablePosition.class);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ConnectablePosition connectablePosition = injection.getExtension(ConnectablePosition.class);
ConnectablePosition oldConnectablePosition = injection.getExtension(ConnectablePosition.class);

return ModificationType.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS.name();
}

private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) {
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos newConnectablePositionInfos, ReportNode subReportNode) {

return branchInfos;
}

private void moveVoltageLevelBusOrBusbarSection(Network network, Connectable<?> connectable, ConnectablePositionModificationInfos info, ReportNode subReportNode) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be named moveFeederBay(). And also modifyVoltageLevelBusOrBusBarSectionAttributes() should be named moveFeederBay(). As the only thing they do is apply moveFeederBay() modfication from powsybl-core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants